package com.pshcp.service;

import com.alibaba.druid.util.StringUtils;
import com.pshcp.domain.dto.SysDictYyDTO;
import com.pshcp.domain.model.SysDictYy;
import com.pshcp.mapper.SysDictYyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class SysDictYyService {

    @Autowired
    private SysDictYyMapper sysDictYyMapper;

    // 根据类型查询数据
    public List<SysDictYyDTO> querySysDictList(SysDictYy sysDictDTO){
        Map<String, Object> map = new HashMap<>();
        if(sysDictDTO.getDictType() != null){
            map.put("dictType", sysDictDTO.getDictType());
        }
        if(!StringUtils.isEmpty(sysDictDTO.getDictCode())){
            map.put("dictCode", sysDictDTO.getDictCode());
        }
        return sysDictYyMapper.querySysDictList(map);
    }
}
